package com.medusa.aps.business.common.security.resource.tool.jwt;

import com.alibaba.fastjson2.JSONB;
import io.jsonwebtoken.io.AbstractDeserializer;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;
import java.io.Reader;
import java.util.Map;

/**
 * @author 张治保
 * @since 2023/11/28
 */
@Slf4j
public class JwtDeserializer<T> extends AbstractDeserializer<T> {

    @Override
    @SuppressWarnings("unchecked")
    protected T doDeserialize(Reader reader) throws IOException {
        try (reader) {
            return (T) JSONB.parseObject(new byte[0], Map.class);
        }

    }
}
